Skip to content

Add {m365_defender,microsoft_defender_endpoint}.vulnerability indices to kibana_system role permissions #132445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 7, 2025

Conversation

kcreddy
Copy link
Contributor

@kcreddy kcreddy commented Aug 5, 2025

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies defined here and here

Related:

Similar to #124074 and #128350

@kcreddy kcreddy requested a review from a team as a code owner August 5, 2025 12:10
@kcreddy kcreddy self-assigned this Aug 5, 2025
@kcreddy kcreddy added :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team Team:Cloud Security Meta label for Cloud Security team >non-issue external-contributor Pull request authored by a developer outside the Elasticsearch team auto-backport Automatically create backport pull requests when merged labels Aug 5, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

Comment on lines 521 to 522
"logs-m365_defender.vulnerability-*",
"logs-microsoft_defender_endpoint.vulnerability-*"
Copy link
Contributor Author

@kcreddy kcreddy Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds permission for the transform, without which results in following error inside the transform:

Cannot create transform [logs-m365_defender.latest_cdr_vulnerabilities-default-0.1.0] because user elastic/kibana lacks the required permissions [logs-m365_defender.vulnerability-*:[read], security_solution-m365_defender.vulnerability_latest:[], security_solution-m365_defender.vulnerability_latest-v1:[]]

Copy link
Contributor

@slobodanadamovic slobodanadamovic Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: Per ILM policy you shared, Kibana needs the permission to execute rollover action but that is already covered by logs-* pattern here:

"logs-*",
"synthetics-*",
"traces-*",
"/metrics-.*&~(metrics-endpoint\\.metadata_current_default.*)/",
".logs-endpoint.action.responses-*",
".logs-endpoint.diagnostic.collection-*",
".logs-endpoint.actions-*",
".logs-endpoint.heartbeat-*",
".logs-osquery_manager.actions-*",
".logs-osquery_manager.action.responses-*",
"logs-osquery_manager.action.responses-*",
"profiling-*"
)
.privileges(
TransportUpdateSettingsAction.TYPE.name(),
TransportPutMappingAction.TYPE.name(),
RolloverAction.NAME,
"indices:admin/data_stream/lifecycle/put"
)

Comment on lines 526 to 534
// For source indices of the Cloud Detection & Response (CDR) packages
// that has ILM policy
RoleDescriptor.IndicesPrivileges.builder()
.indices("logs-m365_defender.vulnerability-*", "logs-microsoft_defender_endpoint.vulnerability-*")
.privileges(
// Require "delete_index" to perform ILM policy actions
TransportDeleteIndexAction.TYPE.name()
)
.build(),
Copy link
Contributor Author

@kcreddy kcreddy Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the permission error for the ILM policy.
The ILM policies are already part of existing integration code: here and here.

Without this correct permissions following error is received when deleting index as user with kibana_system role (as in ILM).

{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "action [indices:admin/delete] is unauthorized for user [kibana-system] with effective roles [editor,kibana_system,viewer] on indices [.ds-logs-m365_defender.vulnerability-default-2025.08.05-000002], this action is granted by the index privileges [delete_index,manage,all]"
      }
    ],
    "type": "security_exception",
    "reason": "action [indices:admin/delete] is unauthorized for user [kibana-system] with effective roles [editor,kibana_system,viewer] on indices [.ds-logs-m365_defender.vulnerability-default-2025.08.05-000002], this action is granted by the index privileges [delete_index,manage,all]"
  },
  "status": 403
}

@kcreddy
Copy link
Contributor Author

kcreddy commented Aug 6, 2025

@slobodanadamovic, I couldn't see labels v8.18.6, v8.19.2, v9.0.6, v9.1.2. We would like to backport to those versions.

Copy link
Contributor

@slobodanadamovic slobodanadamovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (from es-security side; left only optional comments)

Please make sure to get approval from @elastic/kibana-security team as well.

@slobodanadamovic
Copy link
Contributor

@slobodanadamovic, I couldn't see labels v8.18.6, v8.19.2, v9.0.6, v9.1.2. We would like to backport to those versions.

The v8.18.6 and v9.0.6 are not available because 8.18.5 and 9.0.5 are not released yet.

@mattc58
Copy link
Contributor

mattc58 commented Aug 6, 2025

And 8.18 is no longer being maintained. 8.19 is the last branch available on the 8.x line.

@mattc58
Copy link
Contributor

mattc58 commented Aug 6, 2025

I'm wrong about the 8.18 being unmaintained now. It will be maintained until 9.2 is released. Sorry about that--so +1 on backporting to 8.18.x.

kcreddy added 3 commits August 6, 2025 18:52
…permissions

# Conflicts:
#	x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java
@kcreddy kcreddy added v9.0.6 and removed v9.0.5 labels Aug 7, 2025
@kcreddy kcreddy merged commit 716bff8 into elastic:main Aug 7, 2025
39 checks passed
kcreddy added a commit to kcreddy/elasticsearch that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (elastic#132445)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
kcreddy added a commit to kcreddy/elasticsearch that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (elastic#132445)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
kcreddy added a commit to kcreddy/elasticsearch that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (elastic#132445)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
@kcreddy
Copy link
Contributor Author

kcreddy commented Aug 11, 2025

💚 All backports created successfully

Status Branch Result
9.1
9.0
8.19
8.18

Questions ?

Please refer to the Backport tool documentation

kcreddy added a commit to kcreddy/elasticsearch that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (elastic#132445)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)

# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java
elasticsearchmachine pushed a commit that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (#132445) (#132627)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
elasticsearchmachine pushed a commit that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (#132445) (#132628)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
elasticsearchmachine pushed a commit that referenced this pull request Aug 11, 2025
… to kibana_system role permissions (#132445) (#132629)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)
elasticsearchmachine pushed a commit that referenced this pull request Aug 11, 2025
…indices to kibana_system role permissions (#132445) (#132630)

* Add {m365_defender,microsoft_defender_endpoint}.vulnerability indices to kibana_system role permissions (#132445)

Add logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* data stream indices to the kibana_system's read privileges. This is required for the latest transform for 3rd party integrations CDR workflows (vulnerability findings) to work.

Also add delete_index on logs-m365_defender.vulnerability-* and logs-microsoft_defender_endpoint.vulnerability-* to facilitate index removal through ILM policies.

(cherry picked from commit 716bff8)

# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java

* fix conflicts

* fix conflicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Cloud Security Meta label for Cloud Security team Team:Security Meta label for security team v8.18.6 v8.19.2 v9.0.6 v9.1.2 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants